public class test {
    //蓝桥杯 加训啦(⭐⭐⭐)
    static Scanner sc = new Scanner(System.in);
    static int n, m, k;
    static int[] arr1, arr2, arr3;
    static int[][] dp;
    static int N = (int) 1e5;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        k = sc.nextInt();
        arr1 = new int[n + 1]; // 士兵初始力量
        arr2 = new int[m + 1]; // 力量提升值
        arr3 = new int[m + 1]; // 精力消耗值
        dp = new int[m + 1][N + 1];

        for (int i = 1; i <= n; i++) {
            arr1[i] = sc.nextInt();
        }
        for (int i = 1; i <= m; i++) {
            arr2[i] = sc.nextInt();
        }
        for (int i = 1; i <= m; i++) {
            arr3[i] = sc.nextInt();
        }

        // 初始化dp数组
        for (int i = 0; i <= m; i++) {
            Arrays.fill(dp[i], N);
            dp[i][0] = 0;
        }

        // 完全背包计算提升i力量需要的最少精力
        for (int i = 1; i <= m; i++) {
            for (int j = 0; j <= N; j++) {
                if (j >= arr2[i]) {
                    dp[i][j] = Math.min(dp[i - 1][j], dp[i][j - arr2[i]] + arr3[i]);
                } else {
                    dp[i][j] = Math.min(dp[i - 1][j], dp[i][0] + arr3[i]);
                }
            }
        }

        // 二分出满足k精力能达到的最大力量
        int l = 1, r = N;
        while (l < r) {
            int mid = l + r + 1 >> 1;
            if (check(mid)) {
                l = mid;
            } else {
                r = mid - 1;
            }
        }
        System.out.println(l);
    }

    static boolean check(int mid) {
        // 对每个士兵计算到达mid训练需要消耗的精力
        int k1 = 0;
        for (int i = 1; i <= n; i++) {
            if (mid > arr1[i]) k1 += dp[m][mid - arr1[i]];
        }
        return k1 <= k;
    }
    //蓝桥杯 数字三角形(⭐⭐)
    public static int N = 105;
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        //在此输入您的代码...
        int n = in.nextInt();
        int[][] nums = new int[N][N];
        for(int i = 1;i <= n;i++){
            for(int j = 1;j <= i;j++){
                nums[i][j] = in.nextInt();
            }
        }
        int[][] dp = new int[N][N];
        //dp[0][0] = nums[1][1];
        int max = 0;
        for(int i = 1;i <= n;i++){
            for(int j = 1;j <= i;j++){
                dp[i][j] = Math.max(dp[i-1][j],dp[i-1][j-1]) + nums[i][j];
                max = Math.max(dp[i][j],max);
            }
        }
        System.out.println(max);
        in.close();
    }
    //蓝桥杯 迪沃斯定理(⭐⭐)
    //最少严格上升子序列划分个数
    public static int dfs2(int[] nums) {
        int n = nums.length;
        int[] dp = new int[n];
        Arrays.fill(dp, 1);
        int num = 1;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[i] <= nums[j]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            num = Math.max(num, dp[i]);
        }
        return num;
    }
    //最少非严格上升子序列划分个数
    public static int dfs4(int[] nums) {
        int n = nums.length;
        int[] dp = new int[n];
        Arrays.fill(dp, 1);
        int num = 1;
        for (int i = 1; i < n; i++) {
            for (int j = 0; j < i; j++) {
                if (nums[i] < nums[j]) {
                    dp[i] = Math.max(dp[i], dp[j] + 1);
                }
            }
            num = Math.max(num, dp[i]);
        }
        return num;
    }
}
